<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ page isELIgnored="false"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="<s:url value="/resources"/>/css/common.css" type="text/css" />   
<link rel="stylesheet" href="<s:url value="/resources"/>/css/innerstyle.css" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/cupertino/jquery-ui.custom.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/ui.multiselect.css" />
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-ui-1.8.23.custom.min.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/i18n/grid.locale-cn.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/i18n/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.form.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/json2.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/messages_zh.js"></script>
</head>
<script type="text/javascript">
    $(function(){ 
	    $("#but1").button();
	    $("#but2").button(); 
	    $( "#dialog-confirm" ).dialog({
            autoOpen: false,            
			resizable: false,
			height:140,
			modal: true,
			buttons: {
				"确认": function() {
					$("#form1").ajaxSubmit({
		              url:'<s:url value="/jydz"/>/saveDzzb',
		              type:'post',
		              success:function(data){
			              var ret = eval('(' + data + ')');
			              alert(ret.msg);
			              if(ret.success==true)
			              {
			                 window.location.href="<s:url value="/jydz"/>/findZhib";
			              }
		              }		              
			         });
				},
				"返回": function() {
					$( this ).dialog( "close" );
				}
			}
		});  
		
		//为提交按钮绑定事件
	    $("#but1").click(function () {
             $("#dialog-confirm").dialog("open");
          });
     });
    
</script>

<body>
<div id="best1" >
	<h2><span>定制指标</span></h2>
	<form name="form1" id="form1">
    <% int i = 0 ;
       int j = 0 ;%>
	 <table id="tab1" align="center" cellpadding="0" cellspacing="0" class="content_gridview">
	    <tr><th colspan="6" align="center" style=" font-size:16px ; font:bold 16px/24px Arial, Helvetica, sans-serif; color:#327C8E;">基本指标</th></tr>
		 <tr>
		 <c:forEach items="${jbzb}" var="jbzb">
		  <%  
		      if(i<6)
		         {i=i+1;
		   %>
		    <td>
		        <c:choose>
		            <c:when test="${jbzb.ischecked == 0 }">
                         <input type="checkbox" value="${jbzb.zhibid}" name="zhibids" /><c:out value="${jbzb.zhibmc}"  />
                    </c:when>
                    <c:otherwise>
                         <input type="checkbox" value="${jbzb.zhibid}" name="zhibids" checked="checked" /><c:out value="${jbzb.zhibmc}" />
                    </c:otherwise>
                </c:choose>
		    </td>
		     <%}else
		       {
		         i=0;
		         %>
		         </tr>
		         <tr>
		         <%
		       }
		    %>
	      </c:forEach>
	      <% if(i != 0)
	      {%>
	             <td colspan="<%= (6-i)%>">&nbsp;</td>
	             </tr>
	       <%     
	       }%>
	 </table>
	  <table id="tab2" align="center" cellpadding="0" cellspacing="0" class="content_gridview">
	    <tr><th colspan="6" align="center" style=" font-size:16px ; font:bold 16px/24px Arial, Helvetica, sans-serif; color:#327C8E;">自定义指标</th></tr>
	    <tr>
		 <c:forEach items="${zdyzb}" var="zdyzb">
		  <%  
		      if(j<6)
		         { j=j+1;
		 %>
		    <td>
		        <c:choose>
		            <c:when test="${zdyzb.ischecked == 0 }">
		               <input type="checkbox" value="${zdyzb.zhibid}" name="zhibids"/><c:out value="${zdyzb.zhibmc}" />
		            </c:when>
		             <c:otherwise>
                                <input type="checkbox" value="${zdyzb.zhibid}" name="zhibids" checked="checked"/><c:out value="${zdyzb.zhibmc}"/>
                           </c:otherwise>
                        </c:choose>
		    </td>
		     <%}else
		       {
		         j=0;
		         %>
		         </tr>
		         <tr>
		         <%
		       }
		    %>
	      </c:forEach>
              <% if(j != 0)
	      {%>
	             <td colspan="<%= (6-j)%>">&nbsp;</td>
	             </tr>
	       <%     
	       }%>
	       
	      <tr>
		    <td colspan="6" align="center">		    
			    <input id="but1" type="button" name="" value="保存"/>&nbsp;&nbsp;&nbsp;
			    <input id="but2" type="reset" name="" value="重置" />
		     </tr>
	      </tr>
        </table>
	</form>
</div>
<div id="dialog-confirm" title="是否确认保存？"></div>
</body>
</html>
